package com.upload.upload;

import com.upload.upload.service.FilesStorageService;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.Resource;


// demo url: https://www.bezkoder.com/spring-boot-file-upload/
@SpringBootApplication
public class SpringbootUploadFilesApplication implements CommandLineRunner {

    @Resource
    FilesStorageService filesStorageService;
    public static void main(String[] args) {
        SpringApplication.run(SpringbootUploadFilesApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        // filesStorageService.deleteAll();
        filesStorageService.init();
    }
}
